package 高级;

import java.util.*;

public class Zuoye04214 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Map<String, String> a = new HashMap<>();
        a.put("汽车","car");
        a.put("狗","dog");
        a.put("猫","cat");
        a.put("老虎", "tiger");
        a.put("鱼","fish");
        a.put("人","ren");
        System.out.println("请输入要翻译的中文或英文：");
        String b = input.next();
        if (b.matches("[a-zA-Z]+") && !a.containsValue(b)) {
            System.out.println("无该词");
            return;
        }
        if (b.matches("[\u4e00-\u9fa5]+") && !a.containsKey(b)) {
            System.out.println("无该词");
            return;
        }
        Set<Map.Entry<String, String>> set = a.entrySet();
        Iterator<Map.Entry<String, String>> ir = set.iterator();
        while (ir.hasNext()) {
            Map.Entry<String, String> next = ir.next();
            String key = next.getKey();
            String value = next.getValue();
            if (b.equals(key)) {
                System.out.println(b + "=" + value);
            } else if (b.equals(value)) {
                System.out.println(b + "=" + key);
            }
        }
    }
}
